package com.example.support.oss;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.UUID;

import org.apache.commons.io.FilenameUtils;

public class AliOssHelper {

	public static String destPath(String filename) {
		String extension = FilenameUtils.getExtension(filename);
		if (!extension.isEmpty()) {
			extension = "." + extension;
		}
		return LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"))
				+ "/"
				+ UUID.randomUUID().toString().replace("-", "")
				+ extension;
	}

}
